﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

namespace NSQL.Expressions
{
    public class UnaryExpression : BaseExpression, IUnaryExpression
    {
        public INumericExpression Expression { get; set; }
        public UnaryOperator Operator { get; set; }

        public UnaryExpression(IValueExpression expression, UnaryOperator @operator)
        {
            Expression = (INumericExpression) expression;
            Operator = @operator;
        }

        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);
    }
}